const coordinateArrSort=function coordinateArrSort(Arr){
			 //求圆心
			 var xArr=[];
			 var yArr=[];
			 Arr.forEach(item=>{  
						  xArr.push(item[0])
						  yArr.push(item[1])
			 });
			 var xMax = Math.max.apply(null,xArr);
			 var xMin=Math.min.apply(null,xArr);
			 var yMax = Math.max.apply(null,yArr);
			 var yMin=Math.min.apply(null,yArr);
			 var centerCoorX= (parseFloat(xMax)+parseFloat(xMin))/2;
			 var centerCoorY= (parseFloat(yMax)+parseFloat(yMin))/2;
			 var centerCoor=[centerCoorX,centerCoorY]; //原心
			 // 分四个象限
			 var firstQuadrant=[];
			 var secondQuadrant=[];
			 var thirdQuadrant=[];
			 var fourthQuadrant=[];
			 Arr.forEach(item=>{
						     if(item[0]-centerCoor[0]>=0 && item[1]-centerCoor[1]>=0){
								 firstQuadrant.push(item);
							 }
							 if(item[0]-centerCoor[0] <=0 && item[1]-centerCoor[1]>=0){
							 	 secondQuadrant.push(item);
							 }
							 if(item[0]-centerCoor[0]>0 && item[1]-centerCoor[1]<0){
							 	 fourthQuadrant.push(item);
							 }
							 if(item[0]-centerCoor[0] <0 && item[1]-centerCoor[1]<0){
							 	  thirdQuadrant.push(item);
							 }
			 });
			var compare =  function compare(coordinate,rule){
						     var i=0;
							 if(coordinate=="x"){
								 i=0;
							 }
							 if(coordinate=="y"){
								 i=1;
							 }
						     return function(a,b){
						          var value1 = a[i];
						          var value2 = b[i];
								  if(rule=="asc"){
									  return value1 - value2;
								  }
								  if(rule=="desc"){
									    return value2 - value1;
								  }
								  return value1 - value2;
						      }
			 }
			 secondQuadrant.sort(compare("y","asc"));
			 firstQuadrant.sort(compare("x","asc"));
			 fourthQuadrant.sort(compare("y","desc"));
			 thirdQuadrant.sort(compare("x","desc"));
			 var newArrTmp=[];
			 secondQuadrant.forEach(node=>{
						  newArrTmp.push(node);
			 })
			 firstQuadrant.forEach(node=>{
			 			  newArrTmp.push(node);
			 })
			 fourthQuadrant.forEach(node=>{
			 		     newArrTmp.push(node);
			 })
			 thirdQuadrant.forEach(node=>{
			 			  newArrTmp.push(node);
			 })
			 return newArrTmp;
		}
			 
			 
			 export default coordinateArrSort